﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.ServiceModel;

namespace PServiceBus.WCF.NetTcpTransport {
    [Serializable]
    [DataContract]
    public class BindingInfo {
        [DataMember]
        public SecurityMode SecurityMode { get; set; }
        [DataMember]
        public TransferMode TransferMode { get; set; }
        [DataMember]
        public int MaxReceivedMessageSize { get; set; }
        [DataMember]
        public int MaxBufferSize { get; set; }
        [DataMember]
        public int MaxArrayLength { get; set; }
        [DataMember]
        public int MaxBytesPerRead { get; set; }
        [DataMember]
        public int MaxStringContentLength { get; set; }
        [DataMember]
        public int MaxNameTableCharCount { get; set; }
        [DataMember]
        public int MaxDepth { get; set; }
        [DataMember]
        public int MaxItemsInObjectGraph { get; set; }

        public BindingInfo() {
            SecurityMode = SecurityMode.None;
            TransferMode = TransferMode.Streamed;
            MaxReceivedMessageSize = Int32.MaxValue;
            MaxBufferSize = Int32.MaxValue;
            MaxArrayLength = Int32.MaxValue;
            MaxBytesPerRead = Int32.MaxValue;
            MaxStringContentLength = Int32.MaxValue;
            MaxNameTableCharCount = Int32.MaxValue;
            MaxDepth = Int32.MaxValue;
            MaxItemsInObjectGraph = Int32.MaxValue;
        }
    }
}
